package com.aierkeji.call.cms.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.aierkeji.call.cms.entity.contants.CallResult;
import com.aierkeji.call.cms.entity.contants.CallStatus;
import com.aierkeji.call.cms.entity.snap.AkjCallUserSnap;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 线索呼叫历是记录
 * 
 * @author 陈宇强
 *
 */
@Entity
@Table(name = "akj_call_clue_histroy")
public class AkjCallClueHistroy {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", length = 32)
	private Long id;

	@ManyToOne(targetEntity = AkjCallUserSnap.class, cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
	@JoinColumn(name = "created_by", nullable = true)
	@NotFound(action = NotFoundAction.IGNORE)
	private AkjCallUserSnap createdBy;

	@Column(columnDefinition = "datetime")
	private Date createdAt;

	@Column(columnDefinition = "datetime")
	private Date callAt;

	@Column(length = 10)
	@Enumerated(EnumType.STRING)
	private CallStatus callStatus;// 呼叫状态

	@Column(length = 10)
	@Enumerated(EnumType.STRING)
	private CallResult callResult;// 呼叫结果

	@Column(length = 300)
	private String callRemark;// 最新呼叫备注

	@Column
	private Long clueId;// 线索id

	@Column
	private Long callTime;// 呼叫时长

	@Column
	private String phone;// 电话
	
	@Column
	private Long groupId;// 线索分组ID
	
	@Column
	private Long isExtra;//异常数据
	
	@Column
	private String version;//版本号
	
	
	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}
	
	
	public Long getIsExtra() {
		return isExtra;
	}

	public void setIsExtra(Long isExtra) {
		this.isExtra = isExtra;
	}

	public Long getCallTime() {
		return callTime;
	}

	public void setCallTime(Long callTime) {
		this.callTime = callTime;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public AkjCallUserSnap getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(AkjCallUserSnap createdBy) {
		this.createdBy = createdBy;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public CallStatus getCallStatus() {
		return callStatus;
	}

	public void setCallStatus(CallStatus callStatus) {
		this.callStatus = callStatus;
	}

	public CallResult getCallResult() {
		return callResult;
	}

	public void setCallResult(CallResult callResult) {
		this.callResult = callResult;
	}

	public String getCallRemark() {
		return callRemark;
	}

	public void setCallRemark(String callRemark) {
		this.callRemark = callRemark;
	}

	public Long getClueId() {
		return clueId;
	}

	public void setClueId(Long clueId) {
		this.clueId = clueId;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

	public Date getCallAt() {
		return callAt;
	}

	public void setCallAt(Date callAt) {
		this.callAt = callAt;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

}
